Class MCUImpl

All Implemented Interfaces:
IPCObject, Device, MCU
Direct Known Subclasses:
MCUComponentImpl, SBCImpl

public class MCUImpl extends DeviceImpl implements MCU
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • getDigitalSlotsOffset

      public int getDigitalSlotsOffset()
      Information provided by the PKI file:
      
          \class MCU
          
          \brief MCU is the class for a mcu board component, used to make and control things.
          
          \example network().getDevice("MCU0")
          
          \brief Analog and digital slots share the same indexing.  This returns the starting index of the digital slots.
          
          \return int, the starting index of the digital slots.
          
              
      Specified by:
      getDigitalSlotsOffset in interface MCU
      Returns:
      int Returns a int
    • getDigitalSlotsCount

      public int getDigitalSlotsCount()
      Information provided by the PKI file:
      
          \brief Returns the number of digital slots.
          
          \return int, the number of digital slots.
          
              
      Specified by:
      getDigitalSlotsCount in interface MCU
      Returns:
      int Returns a int
    • getAnalogSlotsOffset

      public int getAnalogSlotsOffset()
      Information provided by the PKI file:
      
          \brief Analog and digital slots share the same indexing.  This returns the starting index of the analog slots.
          
          \return int, the starting index of the analog slots.
          
              
      Specified by:
      getAnalogSlotsOffset in interface MCU
      Returns:
      int Returns a int
    • getAnalogSlotsCount

      public int getAnalogSlotsCount()
      Information provided by the PKI file:
      
          \brief Returns the number of analog slots.
          
          \return int, the number of analog slots.
          
              
      Specified by:
      getAnalogSlotsCount in interface MCU
      Returns:
      int Returns a int
    • getSlotsCount

      public int getSlotsCount()
      Information provided by the PKI file:
      
          \brief Returns the total number of analog and digital slots.
          
          \return int, the total number of analog and digital slots.
          
              
      Specified by:
      getSlotsCount in interface MCU
      Returns:
      int Returns a int
    • getComponentAtSlot

      public IoEComponent getComponentAtSlot(int slotNum)
      Information provided by the PKI file:
      
          \brief Returns the component at the given slot index.
          
          \param slotNum, slot index to retrive the component from.
          
          \return IoEComponent, the component at the given slot index.  Remember that analog and digital indexes need to be offset with getAnalogSlotsOffset() or getDigitalSlotsOffset().
          
              
      Specified by:
      getComponentAtSlot in interface MCU
      Parameters:
      slotNum - Takes in a parameter of slotNum
      Returns:
      IoEComponent Returns a IoEComponent
    • getComponentByName

      public IoEComponent getComponentByName(String slotName)
      Information provided by the PKI file:
      
          \brief Returns the component with the given name.
          
          \param slotName, slot name to retrive the component from.  Something like "D0" or "A1"
          
          \return IoEComponent, the component with the given name.
          
              
      Specified by:
      getComponentByName in interface MCU
      Parameters:
      slotName - Takes in a parameter of slotName
      Returns:
      IoEComponent Returns a IoEComponent
    • digitalWrite

      public void digitalWrite(int slotNum, int value)
      Information provided by the PKI file:
      
          \brief Writes a digital signal with the given value to the given slot.
          
          \param slotNum, slot index to write to.
          \param value, value to write.
          
              
      Specified by:
      digitalWrite in interface MCU
      Parameters:
      slotNum - Takes in a parameter of slotNum
      value - Takes in a parameter of value
    • analogWrite

      public void analogWrite(int slotNum, int value)
      Information provided by the PKI file:
      
          \brief Writes a analog signal with the given value to the given slot.
          
          \param slotNum, slot index to write to.
          \param value, value to write.
          
              
      Specified by:
      analogWrite in interface MCU
      Parameters:
      slotNum - Takes in a parameter of slotNum
      value - Takes in a parameter of value
    • addSerialOutputs

      public void addSerialOutputs(String output)
      Information provided by the PKI file:
      
          \brief Writes to the mcu output.  Text appears in the MCU output dialog.
          
          \param output, text to write.
          
              
      Specified by:
      addSerialOutputs in interface MCU
      Parameters:
      output - Takes in a parameter of output
    • getSerialOutputs

      public String getSerialOutputs()
      Information provided by the PKI file:
      
          \brief Gets the mcu output.  It is the text that appears in the MCU output dialog.
          
          \return string, value is the text that appears in the MCU output dialog.
          
              
      Specified by:
      getSerialOutputs in interface MCU
      Returns:
      String Returns a String
    • clearSerialOutputs

      public void clearSerialOutputs()
      Information provided by the PKI file:
      
          \brief Clears the MCU output dialog.
          
              
      Specified by:
      clearSerialOutputs in interface MCU
    • setSubComponentIndex

      public void setSubComponentIndex(String componentName, int index)
      Information provided by the PKI file:
      
          \brief Sets the current image index of the subcomponent
          
          \arg componentName, name of the component
          \arg index, index to set it to
          
              
      Specified by:
      setSubComponentIndex in interface MCU
      Parameters:
      componentName - Takes in a parameter of componentName
      index - Takes in a parameter of index
    • getSubComponentIndex

      public int getSubComponentIndex(String componentName)
      Information provided by the PKI file:
      
          \brief Gets the index of the subcomponent
          
          \arg componentName, name of the component
          
          \return int, index of the component
          
              
      Specified by:
      getSubComponentIndex in interface MCU
      Parameters:
      componentName - Takes in a parameter of componentName
      Returns:
      int Returns a int